<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>构造函数</title>
		<script>
			//var per1={name:"小明",age:8,gender:"男",id:001};
			//var per2={name:"小花",age:7,gender:"女",id:002};
			//var per3={name:"小丽",age:8,gender:"女",id:003};
			//var per4={name:"小强",age:9,gender:"男",id:004};
			//console.log("姓名："+per1.name+",年龄："+per1.age+",性别："+per1.gender+",学号："+per1.id);
		
			//创建Person类
			function Person(name,age,gender,id){
				this.name=name;
				this.age=age;
				this.gender=gender;
				this.id=id;
				console.log("姓名："+this.name+",年龄："+this.age+",性别："+this.gender+",学号："+this.id);
			}
			var per1=new Person("小明",8,"男",001);
			var per2=new Person("小花",7,"女",002);
			var per3=new Person("小丽",6,"女",003);
			var per4=new Person("小强",9,"男",004);
			console.log(typeof Person());
		</script>
	</head>
	<body>
	</body>
</html>
